package kr.co.fotosketch.spring.sample01_04.user;

import java.sql.SQLException;

import kr.co.fotosketch.spring.sample01_01.user.domain.User;
import kr.co.fotosketch.spring.sample01_04.user.dao.ConnectionMaker;
import kr.co.fotosketch.spring.sample01_04.user.dao.DConnectionMaker;
import kr.co.fotosketch.spring.sample01_04.user.dao.UserDao;

public class UserDaoTest {
	public static void main(String[] args) throws ClassNotFoundException, SQLException {
		ConnectionMaker cm = new DConnectionMaker();

		User user = new User();
		
		user.setId("id1");
		user.setName("WGS");
		user.setPassword("123434");
		
		UserDao userDao = new UserDao(cm);
		userDao.addUser(user);
		
		System.out.println("add user : " + user.getId());
		
		User user2 = userDao.getUser(user.getId());
		System.out.println("get user : " + user2.getName());
	}
}
